home *** CD-ROM | disk | FTP | other *** search
- Const msiNoAction = -1
- Const msiInstallStateAdvertise = 1
- Const msiInstallStateAbsent = 2
- Const msiInstallStateLocal = 3
- Const msiInstallStateSource = 4
- Const msiInstallStateDefault = 5
- Dim nRemoveVBAEN:nRemoveVBAEN = 0
- Dim nRemoveVBACZ:nRemoveVBACZ = 0
- Dim nRemoveVBANL:nRemoveVBAPL = 0
-
- On Error Resume Next
-
-
- If (IsFeatureExists("EN") = 1) Then
- If (Session.Property("ENLANG") = "1") Then
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("English") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("English") = msiInstallStateAbsent
- End if
- End If
- If (IsFeatureExists("FR") = 1) Then
- If (Session.Property("FRLANG") = "1") Then
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("French") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("French") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("DE") = 1) Then
- If (Session.Property("DELANG") = "1") Then
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("German") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("German") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("JP") = 1) Then
- If (Session.Property("JPLANG") = "1") Then
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("Japanese") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("Japanese") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("IT") = 1) Then
- If (Session.Property("ITLANG") = "1") Then
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("Italian") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("Italian") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("ES") = 1) Then
- If (Session.Property("ESLANG") = "1") Then
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("Spanish") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("Spanish") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("BP") = 1) Then
- If (Session.Property("BPLANG") = "1") Then
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("Portuguese") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("Portuguese") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("NL") = 1) Then
- If (Session.Property("NLLANG") = "1") Then
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("Dutch") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("Dutch") = msiInstallStateAbsent
- End If
- End If
- If (IsFeatureExists("PL") = 1) Then
- If (Session.Property("PLLANG") = "1") Then
- If (IsFeatureSelected("DrawProgramFiles") = True) Then
- Session.FeatureRequestState("Polish") = msiInstallStateLocal
- End If
- Else
- Session.FeatureRequestState("Polish") = msiInstallStateAbsent
- End If
- End If
-
- If (nRemoveVBAEN = 1) And (nRemoveVBAPL = 1) And (nRemoveVBACZ = 1) Then
- Session.FeatureRequestState("VBAEN") = msiInstallStateAbsent
- End If
-
- '///////////////////////////////////////////////////////////////////////////
- Function IsFeatureExists(sFeature)
- On Error Resume Next
-
- Dim objDB: Set objDB = Session.Database
-
- Dim sQuery: sQuery = "SELECT * FROM `Feature` WHERE `Feature`.`Feature` = '" & sFeature & "'"
-
- Dim objView: Set objView = objDB.OpenView(sQuery)
- objView.Execute
-
- Dim objRec: Set objRec = objView.Fetch
-
- If (objRec Is Nothing) Then
- ' not there
- IsFeatureExists = 0
- Else
- ' there
- IsFeatureExists = 1
- End If
-
- End Function
-
- '*********************************************************************************************
- ' Function: getFeatureAction(sFeature)
- '
- ' Args: STRING sFeature = `Feature`.`Feature`
- '
- ' Returns: The current install state of the feature
- '
- '*********************************************************************************************
- Function getFeatureState(sFeature)
- On Error Resume Next
- getFeatureState = Session.FeatureCurrentState(sFeature)
- End Function
-
- '*********************************************************************************************
- ' Function: getFeatureAction(sFeature)
- '
- ' Args: STRING sFeature = `Feature`.`Feature`
- '
- ' Returns: The requested action of the feature
- '
- '*********************************************************************************************
- Function getFeatureAction(sFeature)
- On Error Resume Next
- getFeatureAction = Session.FeatureRequestState(sFeature)
- End Function
-
-
- '*********************************************************************************************
- ' Function: IsFeatureSelected(sFeature)
- '
- ' Args: STRING sFeature = `Feature`.`Feature`
- '
- ' Returns: True \ False
- '
- ' Notes: Determines if a feature is selected for install
- '*********************************************************************************************
- Function IsFeatureSelected(sFeature)
- On Error Resume Next
- Dim nState: nState = getFeatureState(sFeature)
- Dim nAction: nAction = getFeatureAction(sFeature)
-
- If ((nAction > msiInstallStateAbsent) Or ((nState > msiInstallStateAbsent) And (nAction = msiNoAction))) Then
- IsFeatureSelected = True
- Else
- IsFeatureSelected = False
- End If
-
- End Function